<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" th:with="title='党建',active='party'">
<header th:replace="comm/header::headerFragment(${title},${active})"></header>
<link th:href="@{/admin/plugins/tagsinput/jquery.tagsinput.css}" rel="stylesheet"/>
<link th:href="@{/admin/plugins/select2.dist.css/select2-bootstrap.css}" rel="stylesheet"/>
<link th:href="@{/admin/plugins/toggles/toggles.css}" rel="stylesheet"/>
<link th:href="@{/admin/plugins/md/css/style.css}" rel="stylesheet"/>
<link th:href="@{/plugins/dropzone/dropzone.css}" rel="stylesheet"/>
<link th:href="@{/plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.min.css}" rel="stylesheet"/>
<link th:href="@{/plugins/nice-validator-0.8.1/jquery.validator.css}" rel="stylesheet"/>
<link rel="stylesheet" th:href="@{/plugins/kkpager/kkpager_blue.css}">

<style>
    #tags_tagsinput {
        background-color: #fafafa;
        border: 1px solid #eeeeee;
    }

    #tags_addTag input {
        width: 100%;
    }

    #tags_addTag {
        margin-top: -5px;
    }

    #dropzone {
        margin-bottom: 3rem;
    }

    .dropzone {
        border: 2px dashed #0087F7;
        border-radius: 5px;
        background: white;
    }

    .dropzone .dz-message {
        font-weight: 400;
    }

    .dropzone .dz-message .note {
        font-size: 0.8em;
        font-weight: 200;
        display: block;
        margin-top: 1.4rem;
    }

    .attach-img {
        width: 100px;
        height: 100px;
        border-radius: 10px;
        box-shadow: 0px 0px 8px #333;
    }

    .attach-text {
        font-size: 12px;
        font-weight: 300;
    }

    .attach-img:hover {
        background-color: #f9f9f9;
    }

    .n-invalid {
        border: 1px solid #c00;
    }
</style>

<body class="fixed-left">
<div id="wrapper">
    <div th:replace="comm/header::header-body"></div>
    <div class="content-page">
        <div class="content">
            <div class="container">
                <div class="row">
                    <div class="col-sm-12">
                        <h4 class="page-title">
                            发布/编辑活动
                        </h4>
                    </div>
                    <div class="col-md-12">
                        <form class="form-horizontal" role="form" id="global-form">
                            <div class="form-group">
                                <label class="col-sm-1 control-label">活动名称</label>
                                <div class="col-md-10">
                                    <input type="text" class="form-control" name="title" id="title" required="required"
                                           aria-required="true" th:value="${buildingEvent?.title}"/>
                                </div>
                            </div>
                              <div class="form-group">
                                     <label class="col-sm-1 control-label">宣传图片</label>
                                    <div class="col-md-6">
                                        <span>将文件拖至此处或点击空白处上传</span>
                                   <div  class="dropzone" id="dropzone">
                                    <div class="fallback">
                                        <input name="file" type="file" multiple="multiple"/>
                                    </div>
                                    <input name="files" id="image_files" style="display: none;">
                                    <!--<div class="dz-message">-->
                                                                                              <!--将文件拖至此处或点击上传-->
                                    <!--</div>-->
                                    </div>
                                     </div>
                                    </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">报名截止日期</label>
                                <div class="col-md-4">
                                    <input type="text" name="registrationDeadline" id="registrationDeadline"
                                           class="form-control datetimepicker" th:value="${buildingEvent?.registrationDeadline}">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">活动时间</label>
                                <div class="col-md-4">
                                    <input type="text" name="startTime" id="startTime"
                                           class="form-control datetimepicker" th:value="${buildingEvent?.startTime}">
                                </div>

                                <div class="col-md-4">
                                    <input type="text" name="endTime" id="endTime"
                                           class="form-control datetimepicker" th:value="${buildingEvent?.endTime}">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">活动地点</label>
                                <div class="col-md-10">
                                    <input type="text" class="form-control" name="site" id="site" required="required"
                                           aria-required="true" th:value="${buildingEvent?.site}"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">报名名额</label>
                                <div class="col-md-4">
                                    <input type="text" class="form-control" name="totalUsers" id="totalUsers" required="required"
                                           aria-required="true" th:value="${buildingEvent?.totalUsers}"/>
                                </div>
                                <label class="col-sm-1 control-label">人</label>
                            </div>

                            <div class="clearfix"></div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">活动描述</label>
                                <div class="col-md-6">
                                    <!--<script type="text/plain" id="container" name="basicFunction" style="width:650px;height:500px;"></script>-->
                                    <script type="text/plain" id="container" name="basicFunction"></script>

                                </div>
                            </div>
                            <div class="clearfix"></div>
                            <div class="text-center">
                                <a th:href="@{/party/event/list}"
                                   class="btn btn-primary waves-effect waves-light">取消</a>
                                <button type="submit" class="btn btn-primary waves-effect waves-light">发布</button>
                            </div>
                            <input name="id" id="id" style="display: none;" th:value="*{buildingEvent?.id}">
                        </form>
                    </div>
                </div>
                <div th:replace="comm/footer :: footer-content"></div>
            </div>
        </div>
    </div>
</div>

<div th:replace="comm/footer :: footer"></div>
<script th:src="@{/plugins/dropzone/dropzone.js}"></script>
<script th:src="@{/plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.min.js}"></script>
<script th:src="@{/plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.zh-CN.js}"></script>
<script type="text/javascript" th:src="@{/plugins/ueditor1_4_3-utf8-jsp/ueditor.config.js}"></script>
<script type="text/javascript" th:src="@{/plugins/ueditor1_4_3-utf8-jsp/ueditor.all.js}"></script>
<script type="text/javascript" th:src="@{/plugins/ueditor1_4_3-utf8-jsp/lang/zh-cn/zh-cn.js}"></script>
<script type="text/javascript">
    $('#startTime').datetimepicker({
        format: 'yyyy-mm-dd hh:ii',
        minView: "0",
        language: 'zh-CN',
        autoclose: true,
    }).on('change', function () {
        $(this).attr("class", "form-control");
        $(this).siblings('span').html('');
        var startTime = $("#startTime").val();
        $('#endTime').datetimepicker('setStartDate', startTime);

    });
    $('#endTime').datetimepicker({
        format: 'yyyy-mm-dd hh:ii',
        minView: "0",
        language: 'zh-CN',
        autoclose: true,
    }).on('change', function () {
        $(this).attr("class", "form-control");
        $(this).siblings('span').html('');
        var endTime = $("#endTime").val();
        $('#startTime').datetimepicker('setEndDate', endTime);
    });
    $('#registrationDeadline').datetimepicker({
        format: 'yyyy-mm-dd hh:ii',
        minView: "0",
        language: 'zh-CN',
        autoclose: true,
    }).on('change', function () {
        $(this).attr("class", "form-control");
        $(this).siblings('span').html('');
    });
    Dropzone.autoDiscover = false;
    var ue = UE.getEditor('container', {
        initialFrameWidth: 640, //初始化宽度
        initialFrameHeight: 420, //初始化高度
    });
</script>
<script th:src="@{/admin/plugins/tagsinput/jquery.tagsinput.min.js}"></script>
<!-- editor.md -->
<script th:src="@{//cdn.bootcss.com/jquery-toggles/2.0.4/toggles.min.js}"></script>
<script th:src="@{/plugins/nice-validator-0.8.1/jquery.validator.js}"></script>
<script th:src="@{/plugins/nice-validator-0.8.1/zh-CN.js}"></script>
<script th:src="@{/plugins/UMBinding.js}"></script>
<script th:src="@{/plugins/jQuery-ext/serializeObject.js}"></script>
<script th:src="@{/plugins/kkpager/kkpager.min.js}"></script>
<script th:src="@{/js/party/event/create.js}"></script>
<script th:src="@{/js/common/ArrayUtil.js}"></script>
</body>
</html>